#include "widget.h"
#include "ui_widget.h"
#include<QPushButton>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    this->stu=new students(this);
    this->th=new teacher(this);
    QPushButton* tch_button=new QPushButton(this);
    tch_button->setText("上课了");

    connect(th,&teacher::Mysignal,stu,&students::StartStudy);
    connect(tch_button,&QPushButton::clicked,th,&teacher::Mysignal);
    EmitSignal();
}

void Widget::EmitSignal()
{
    emit th->Mysignal();
}

Widget::~Widget()
{
    delete ui;
}

